<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/4 0004
  Time: 12:47
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="../../../base.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="modal-header">
    <h3 class="text-center text-primary">
        卡片
    </h3>

    <div class="text-left">
        <button type="button" class="btn btn-default" onclick="editCard.goBack()">&lt;&ensp;返回</button>
        <button type="button" class="btn btn-info <c:if test="${empty paperId}">hidden</c:if>"
                onclick="editCard.goPaperPage('${paperId}','${paperCard.paperCardId}');">查看/添加试卷
        </button>
        <button type="button" class="btn btn-primary <c:if test="${empty paperId}">hidden</c:if>"
                onclick="editCard.showFrom();">修改
        </button>
    </div>
</div>
<div class="text-center">
    <br>
    <div class="">
        <%--显示卡片的表单--%>
        <form class="form-horizontal showFrom text-left <c:if test="${empty paperId}">hidden</c:if> ">
            <input value="${paperCard.paperCardId}" hidden name="paperCard.paperCardId">
            <div class="form-group">
                <label class="col-sm-2 control-label">卡片名称</label>
                <div class="col-sm-8">
                    <p class="form-control-static">${paperCard.name}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">卡片描述</label>
                <div class="col-sm-8">
                    <p class="form-control-static">${paperCard.descr}</p>
                </div>
            </div>
            <div class="form-group">
                <label for="status" class="col-sm-2 control-label">状态</label>
                <div class="col-sm-8">
                    <p class="form-control-static">
                        <c:choose>
                            <c:when test="${paperCard.status == 0}">
                                默认（未发布）
                            </c:when>
                            <c:when test="${paperCard.status == 50}">
                                已发布
                            </c:when>
                            <c:when test="${paperCard.status == 99}">
                                废除
                            </c:when>
                        </c:choose>
                    </p>
                </div>
            </div>
            <div class="form-group">
                <label for="pic_front" class="col-sm-2 control-label">卡片正面图片</label>
                <div class="col-sm-8 text-left">
                    <img src=""
                         alt="..." class="img-thumbnail" id="pic_front">
                </div>
            </div>

            <div class="form-group">
                <label for="pic_reverse" class="col-sm-2 control-label">卡片背面图片</label>
                <div class="col-sm-8 text-left">
                    <img src=""
                         alt="..." class="img-thumbnail" id="pic_reverse">
                </div>
            </div>

        </form>
        <%--修改卡片的表单--%>
        <form class="form-horizontal editForm  <c:if test="${!empty paperId}">hidden</c:if>" id="paperCardForm">
            <input value="${paperCard.paperCardId}" hidden name="paperCard.paperCardId">
            <div class="form-group">
                <label for="paperCardName" class="col-sm-2 control-label">卡片名称</label>
                <div class="col-sm-8">
                    <input name="paperCard.name" value="${paperCard.name}" type="text" class="form-control"
                           id="paperCardName"
                           placeholder="名称">
                </div>
            </div>
            <div class="form-group">
                <label for="cardDescr" class="col-sm-2 control-label">卡片描述</label>
                <div class="col-sm-8">
                    <textarea class="form-control" rows="3" id="cardDescr"
                              placeholder="卡片描述">${paperCard.descr}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="status" class="col-sm-2 control-label">状态</label>
                <div class="col-sm-8">
                    <select class="form-control " name="growth.status" id="status">
                        <option value="0" <c:if test="${paperCard.status == 0}"> selected</c:if> >默认（未发布）</option>
                        <option value="50" <c:if test="${paperCard.status == 50}"> selected</c:if> >发布</option>
                        <option value="99" <c:if test="${paperCard.status == 99}"> selected</c:if> >废除</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">卡片正面</label>
                <div class="col-sm-8">
                    <div id="card_front_img" class="zyupload"></div>
                </div>
            </div>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-2 control-label">卡片正面</label>--%>
            <%--<div class="col-sm-8">--%>
            <%--<div id="card_reverse_img" class="zyupload"></div>--%>
            <%--</div>--%>
            <%--</div>--%>

            <div class="form-group">
                <label class="col-sm-2">操作</label>
                <div class="col-sm-8">
                    <button type="button" class="btn btn-danger" onclick="editCard.submitForm();">提交</button>
                    <button type="button" class="btn btn-default <c:if test="${empty paperId}">hidden</c:if>"
                            onclick="editCard.editFrom();">取消
                    </button>
                </div>
            </div>
        </form>

        <%--<form id="cardImg" class="form-horizontal">--%>


        <%--</form>--%>
    </div>
    <%--<div class="modal-footer"></div>--%>

    <%-- 试卷--%>
    <%--<div class="modal-header">--%>
    <%--<h3 class="text-center text-primary">--%>
    <%--试卷--%>
    <%--</h3>--%>
    <%--</div>--%>
    <%--<br>--%>
    <%--<div>--%>
    <%--<form class="form-horizontal" id="paperForm">--%>
    <%--<div class="form-group hidden">--%>
    <%--<label for="paperId" class="col-sm-2 control-label">隐藏域</label>--%>
    <%--<div class="col-sm-8">--%>
    <%--<input name="paper.paperId" id="paperId" value="${paperId}"/>--%>
    <%--<input name="paper.growthId" value="${growthId}"/>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="form-group">--%>
    <%--<label for="paperDescr" class="col-sm-2 control-label">试卷描述</label>--%>
    <%--<div class="col-sm-8">--%>
    <%--<textarea class="form-control" rows="3" id="paperDescr" placeholder="试卷描述"></textarea>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="form-group">--%>
    <%--<label for="tips" class="col-sm-2 control-label">tips</label>--%>
    <%--<div class="col-sm-8">--%>
    <%--<textarea class="form-control" rows="3" id="tips" placeholder="tips"></textarea>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</form>--%>
    <%--</div>--%>
    <%--<div class="modal-footer"></div>--%>
    <%--试题 --%>
    <%--<div class="modal-header">--%>
    <%--<h3 class="text-center text-primary">--%>
    <%--试题--%>
    <%--</h3>--%>
    <%--</div>--%>
    <%--<br>--%>
    <%--<div>--%>
    <%--<form class="form-horizontal" id="questionForm" disabled>--%>
    <%--<div class="form-group hidden">--%>
    <%--<label for="paperId" class="col-sm-2 control-label">隐藏域</label>--%>
    <%--<div class="col-sm-8">--%>

    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="form-group">--%>
    <%--<label for="question" class="col-sm-2 control-label">问题</label>--%>
    <%--<div class="col-sm-8">--%>
    <%--<textarea class="form-control" rows="3" id="question" placeholder="试卷描述"></textarea>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--<div class="form-group">--%>
    <%--<label for="tips" class="col-sm-2 control-label">tips</label>--%>
    <%--<div class="col-sm-8">--%>
    <%--<textarea class="form-control" rows="3" id="tips" placeholder="tips"></textarea>--%>
    <%--</div>--%>
    <%--</div>--%>
    <%--</form>--%>
    <%--</div>--%>
    <%--<div class="modal-footer"></div>--%>

</div>
<script src="${basePath}assets/zyupload/zyupload-1.0.0.js"></script>
<script src="${basePath}js/card_js/editCard.js"></script>